package com.mz.mattress.client.plan;

import java.util.HashMap;
import java.util.Map;

/**
 * 计划任务类型
 */
public enum PlanTypeEnum {

    MEMBER_NEW(1, "memberNewPlanExecutor", 3),
    CREATE_ORDER(2, "createOrderExecutor", 3),
    CHECK_ORDER(3, "checkOrderExecutor", 1),
    ;

    private Integer type;

    private String beanName;

    private Integer totalStep;

    PlanTypeEnum(final Integer type, final String beanName, final Integer totalStep) {
        this.type = type;
        this.beanName = beanName;
        this.totalStep = totalStep;
    }

    private static Map<Integer, PlanTypeEnum> map = new HashMap<>();

    static {
        for (PlanTypeEnum stepEnum : PlanTypeEnum.values()) {
            map.put(stepEnum.type, stepEnum);
        }
    }

    public static PlanTypeEnum valueOf(int type) {
        return map.get(type);
    }

    public Integer getType() {
        return this.type;
    }

    public String getBeanName() {
        return this.beanName;
    }

    public Integer getTotalStep() {
        return this.totalStep;
    }

}
